package picutil

import (
	"image"
	_ "image/jpeg"
	_ "image/png"
	"os"
	"path/filepath"
)

func Config(picFullPath string) image.Config {

	pic, _ := os.Open(picFullPath)
	defer pic.Close()
	config, _, err := image.DecodeConfig(pic)
	if err != nil {
		panic(filepath.Base(picFullPath) + " 可能不是一张图片")
	}
	return config
}
